package com.seeyon.apps.kkTimedTaskSharing.button;

import com.alibaba.druid.support.logging.Log;
import com.alibaba.druid.support.logging.LogFactory;
import com.seeyon.cap4.form.bean.FormBean;
import com.seeyon.cap4.form.bean.FormSaveAsBean;
import com.seeyon.cap4.form.bean.button.CommonBtn;
import com.seeyon.cap4.form.modules.importandexport.BusinessDataBean;
import com.seeyon.cap4.form.util.Enums;
import com.seeyon.ctp.util.json.JSONUtil;
import org.springframework.stereotype.Component;
import www.seeyon.com.utils.UUIDUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: wangtengx
 * @description:
 */


@Component("kkTimedTaskSharingButton")
public class KKTimedTaskSharingButton extends CommonBtn {
    private static final Log log = LogFactory.getLog(KKTimedTaskSharingButton.class);
    public KKTimedTaskSharingButton() {
    }

    public void init() {
        log.info("#kklog---按钮初始化");
        this.setPluginId("signature");
        this.setIcon("cap-icon-custom-button");
    }

    public static void main(String[] args) {
        System.out.println("UUIDUtil.getUUIDLong() = " + UUIDUtil.getUUIDLong());
    }
    public boolean canUse(Enums.FormType formType) {
        return true;
    }

    /**
     * 按钮的唯一值
     * @return
     */
    public String getKey() {
        return "6476455173288637993";
    }

    public String getNameSpace() {
        return "customBtn_" + this.getKey();
    }

    public String getText() {
        return "分享定时任务按钮";
    }

    public String getPCInjectionInfo() {
        Map<String, Object> pMap = new HashMap();
        pMap.put("path", "apps_res/cap/customCtrlResources/kkTimedTaskSharing/");
        pMap.put("jsUri", "js/index.js");
        pMap.put("initMethod", "init");
        pMap.put("nameSpace", this.getNameSpace());
        return JSONUtil.toJSONString(pMap);
    }

    public String getMBInjectionInfo() {
        return null;
    }

    public void getJson4Export(FormBean formBean, String customParam, BusinessDataBean businessDataBean, Map<String, Object> resultMap) {
    }

    public void importInfoAfterBizImport(FormBean formBean, String customParam, BusinessDataBean businessDataBean, Map<String, Object> btnInfoMap) {
    }

    public void otherSave(FormSaveAsBean formSaveAsBean, FormBean formBean, Map<String, Object> btnInfoMap) {
    }


}

